Component({
  /**
   * 组件的属性列表
   */
  properties: {
    columns: {
      type: Array,
      value: [],
    },
    tableData: {
      type: Array,
      value: [],
    },
    tableYHeight: {
      type: Number,
      value: 500,
    },
    userInfo: {
      type: Object,
      value: {},
    },
    orderStatusName: {
      type: Array,
      value: []
    }
  },
  options: {
    styleIsolation: 'apply-shared', //开启后可以通过page页面的wxss来修改组件的样式，主要用来对单元格样式自定义
  },
  /**
   * 组件的初始数据
   */
  data: {
    isShowChild: false,
  },
  // onReady() {
  //   console.log(this.data.orderStatusName)
  // },
  /**
   * 组件的方法列表
   */
  methods: {
    viewOtherProjectMsg(row){
      let orderMsg = row.currentTarget.dataset.order
      wx.setStorageSync('projectName', orderMsg.projectName)
      wx.navigateTo({
        url: '/pages/otherProjectMsg/otherProjectMsg?orderId='+orderMsg.id + '&projectName=' + orderMsg.projectName + '&orderStatusName=' + JSON.stringify(this.data.orderStatusName),
      })
    },
    viewOrderMsg(row){
      let orderMsg = row.currentTarget.dataset.order
      wx.setStorageSync('projectName', orderMsg.projectName)
      wx.navigateTo({
        url: '/pages/orderMsg/orderMsg?orderId='+orderMsg.id + '&projectName=' + orderMsg.projectName + '&orderStatusName=' + JSON.stringify(this.data.orderStatusName),
      })
    },
    showChildList(event) {
      let index = event.currentTarget.dataset.index;
      let tableData = this.data.tableData;
      tableData[index].isShowChild = !tableData[index].isShowChild;
      this.setData({
        tableData: tableData
      })
    }
  },
});
